<?php
/**
 * This file is part of Swoft.
 *
 * @link https://swoft.org
 * @document https://doc.swoft.org
 * @contact group@swoft.org
 * @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
 */

namespace App\Fallback;
use App\Rpc\Lib\OrderInterface;
use App\Rpc\Lib\PayAccountInterface;
use Six\Rpc\Client\Annotation\Mapping\Fallback;


/**
 * Fallback demo
 *
 * @Fallback(name="PayAccountFallback",version="1.0")
 */

class PayAccountServiceFallback implements PayAccountInterface
{

    /**
     * 尝试提交（第一阶段try）
     * @param $context
     * @return array
     */
    public function creditAccountTcc($context):array
    {
        return ['status'=>1,'result' =>'账户尝试提交(第一阶段try)'];
    }


    /**
     * 业务提交执行（第二阶段Confirm）
     * @param $context
     * @return array
     */
    public function confirmCreditAccountTcc($context):array
    {
        return ['status'=>1,'result' =>'账户业务提交执行(第二阶段Confirm)'];
    }


    /**
     * 回滚（第二阶段cancel）
     * @param $context
     * @return array
     */
    public function cancelCreditAccountTcc($context):array
    {
        return ['status'=>1,'result' =>'账户回滚(第二阶段cancel)'];
    }
}